package jym.tan.tmdb.method.get;

import java.net.URL;

import jym.tan.tmdb.TMDB;
import jym.tan.tmdb.bean.wrapper.MovieReleaseWrapper;
import jym.tan.tmdb.constant.TMDBConstants;
import jym.tan.tmdb.method.Base;

/**
 * The Class MovieReleaseInfo. This class is similar to the <b>Movie Release Info</b> method described in 
 * <a href="http://help.themoviedb.org/kb/api/movie-release-info">Movie Release Info</a>.
 * This method is used to retrieve all of the release and certification data we have for a specific movie.
 * @author Tanmoy
 */
public class MovieReleaseInfo extends Base {

	/**
	 * Instantiates a new MovieReleaseInfo.
	 *
	 * @param tmdb 
	 * 		An instance of the {@link TMDB} class
	 */
	public MovieReleaseInfo(TMDB tmdb) {
		super(tmdb, TMDBConstants.MOVIE, TMDBConstants.RELEASES);
	}

	/**
	 * Gets a {@link MovieReleaseWrapper} object.
	 *
	 * @param movieId 
	 * 		The TMDB id / the IMDB id
	 * @return 
	 * 		The <code>MovieReleaseWrapper</code> object
	 * @throws Exception
	 * 		If any kind off exception occurred
	 */
	public MovieReleaseWrapper getMovieReleaseWrapper(String movieId) throws Exception {
		URL movieReleaseURL = getUrl(movieId);
		MovieReleaseWrapper movieReleaseWrapper = getJsonObject(movieReleaseURL, MovieReleaseWrapper.class);
		return movieReleaseWrapper;		
	}
}
